package day07.zuoye.three;

import day01.arrayutil.Student;

public class Undergraduate extends Student {
    private String major;

    public Undergraduate() {
    }

//        Undergraduate[name=XXX,age=XXX,major=XXX] 。


    public Undergraduate(String name, int age, String major) {
        super(name, age);
        this.major = major;
    }

    /**
     * 获取
     *
     * @return major
     */
    public String getMajor() {
        return major;
    }

    /**
     * 设置
     *
     * @param major
     */
    public void setMajor(String major) {
        this.major = major;
    }

    public String toString() {
        return "Undergraduate{major = " + major + "}";
    }

    public void show() {
        System.out.println("Undergraduate[name=" + getName()+ ",age=" + getAge() + ",major=" + major + "]");
    }
}
